//用循环的方法接受用户输入的五个成绩，并求它们的和。
package lesson1;

import java.util.Scanner;

public class Demo {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int num = 1;
        double sum = 0;
		while (num<6) {
			System.out.println("请输入第" + num + "个的成绩");
			double chengji = sc.nextDouble();
			num++;
            sum = sum + chengji;
		}
        System.out.println("成绩总和为：" + sum);
	}
}
